package cn.tedu.springboot.sharding.demo.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @Author: Miyako
 * @Date: 2024-09-27-17:28
 * @Description:
 */
@Mapper
public interface OrderMapper {


    //编写新增方法，通过insert注解，指定新增的SQL语句
//当调用insertOrder方法的时候，等于执行上方注解指定的SQL语句
//Param注解用于指定新增时的参数
    @Insert("insert into mall_order(buyer_id,buyer_username,order_no,receiver_name) " +
            "values(#{buyerId},#{buyerUsername},#{orderNo},#{receiverName})")
    int insertOrder(@Param("buyerId")Long buyerId, @Param("buyerUsername")String buyerUsername
            , @Param("orderNo")String orderNo, @Param("receiverName")String receiverName);



}
